home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / bgui12.lha / include / libraries / bgui_macros.h next >
C/C++ Source or Header  |  1995-06-11  |  25KB  |  1,003 lines

  1. #ifndef LIBRARIES_BGUI_MACROS_H
  2. #define LIBRARIES_BGUI_MACROS_H
  3. /*
  4. **    $VER: libraries/bgui_macros.h 38.6 (11.6.95)
  5. **    bgui.library macros.
  6. **
  7. **    (C) Copyright 1993-1995 Jaba Development.
  8. **    (C) Copyright 1993-1995 Jan van den Baard.
  9. **    All Rights Reserved.
  10. **/
  11.  
  12. #ifndef LIBRARIES_BGUI_H
  13. #include <libraries/bgui.h>
  14. #endif /* LIBRARIES_BGUI_H */
  15.  
  16. /*****************************************************************************
  17.  *
  18.  *    General object creation macros.
  19.  */
  20. #define HGroupObject        BGUI_NewObject( BGUI_GROUP_GADGET
  21. #define VGroupObject        BGUI_NewObject( BGUI_GROUP_GADGET,\
  22.                         GROUP_Style, GRSTYLE_VERTICAL
  23. #define ButtonObject        BGUI_NewObject( BGUI_BUTTON_GADGET
  24. #define ToggleObject        BGUI_NewObject( BGUI_BUTTON_GADGET,\
  25.                         GA_ToggleSelect, TRUE
  26. #define CycleObject        BGUI_NewObject( BGUI_CYCLE_GADGET
  27. #define CheckBoxObject        BGUI_NewObject( BGUI_CHECKBOX_GADGET
  28. #define InfoObject        BGUI_NewObject( BGUI_INFO_GADGET
  29. #define StringObject        BGUI_NewObject( BGUI_STRING_GADGET
  30. #define PropObject        BGUI_NewObject( BGUI_PROP_GADGET
  31. #define IndicatorObject         BGUI_NewObject( BGUI_INDICATOR_GADGET
  32. #define ProgressObject        BGUI_NewObject( BGUI_PROGRESS_GADGET
  33. #define SliderObject        BGUI_NewObject( BGUI_SLIDER_GADGET
  34. #define PageObject        BGUI_NewObject( BGUI_PAGE_GADGET
  35. #define MxObject        BGUI_NewObject( BGUI_MX_GADGET
  36. #define ListviewObject        BGUI_NewObject( BGUI_LISTVIEW_GADGET
  37. #define ExternalObject        BGUI_NewObject( BGUI_EXTERNAL_GADGET, GA_Left, 0, GA_Top, 0, GA_Width, 0, GA_Height, 0
  38. #define SeparatorObject         BGUI_NewObject( BGUI_SEPARATOR_GADGET
  39.  
  40. #define WindowObject        BGUI_NewObject( BGUI_WINDOW_OBJECT
  41. #define FileReqObject        BGUI_NewObject( BGUI_FILEREQ_OBJECT
  42. #define CommodityObject         BGUI_NewObject( BGUI_COMMODITY_OBJECT
  43.  
  44. #define EndObject        TAG_END )
  45.  
  46. /* Typo */
  47. #define SeperatorObject         SeparatorObject
  48.  
  49. /*****************************************************************************
  50.  *
  51.  *    Label creation.
  52.  */
  53. #define Label(l)        LAB_Label, l
  54. #define UScoreLabel(l,u)    LAB_Label, l, LAB_Underscore, u
  55. #define Style(s)        LAB_Style, s
  56. #define Place(p)        LAB_Place, p
  57.  
  58. /*****************************************************************************
  59.  *
  60.  *    Frames.
  61.  */
  62. #define ButtonFrame        FRM_Type, FRTYPE_BUTTON
  63. #define RidgeFrame        FRM_Type, FRTYPE_RIDGE
  64. #define DropBoxFrame        FRM_Type, FRTYPE_DROPBOX
  65. #define NeXTFrame        FRM_Type, FRTYPE_NEXT
  66. #define RadioFrame        FRM_Type, FRTYPE_RADIOBUTTON
  67. #define XenFrame        FRM_Type, FRTYPE_XEN_BUTTON
  68.  
  69. /* For clarity. */
  70. #define StringFrame        RidgeFrame
  71. #define MxFrame                 RadioFrame
  72.  
  73. #define FrameTitle(t)        FRM_Title, t
  74.  
  75. /* Built-in back fills */
  76. #define ShineRaster        FRM_BackFill, SHINE_RASTER
  77. #define ShadowRaster        FRM_BackFill, SHADOW_RASTER
  78. #define ShineShadowRaster    FRM_BackFill, SHINE_SHADOW_RASTER
  79. #define FillRaster        FRM_BackFill, FILL_RASTER
  80. #define ShineFillRaster         FRM_BackFill, SHINE_FILL_RASTER
  81. #define ShadowFillRaster    FRM_BackFill, SHADOW_FILL_RASTER
  82. #define ShineBlock        FRM_BackFill, SHINE_BLOCK
  83. #define ShadowBlock        FRM_BackFill, SHADOW_BLOCK
  84.  
  85. /*****************************************************************************
  86.  *
  87.  *    Vector images.
  88.  */
  89. #define GetPath                 VIT_BuiltIn, BUILTIN_GETPATH
  90. #define GetFile                 VIT_BuiltIn, BUILTIN_GETFILE
  91. #define CheckMark        VIT_BuiltIn, BUILTIN_CHECKMARK
  92. #define PopUp            VIT_BuiltIn, BUILTIN_POPUP
  93. #define ArrowUp                 VIT_BuiltIn, BUILTIN_ARROW_UP
  94. #define ArrowDown        VIT_BuiltIn, BUILTIN_ARROW_DOWN
  95. #define ArrowLeft        VIT_BuiltIn, BUILTIN_ARROW_LEFT
  96. #define ArrowRight        VIT_BuiltIn, BUILTIN_ARROW_RIGHT
  97.  
  98. /*****************************************************************************
  99.  *
  100.  *    Group class macros.
  101.  */
  102. #define StartMember        GROUP_Member
  103. #define EndMember        TAG_END, 0
  104. #define Spacing(p)        GROUP_Spacing, p
  105. #define HOffset(p)        GROUP_HorizOffset, p
  106. #define VOffset(p)        GROUP_VertOffset, p
  107. #define LOffset(p)        GROUP_LeftOffset, p
  108. #define ROffset(p)        GROUP_RightOffset, p
  109. #define TOffset(p)        GROUP_TopOffset, p
  110. #define BOffset(p)        GROUP_BottomOffset, p
  111. #define VarSpace(w)        GROUP_SpaceObject, w
  112. #define EqualWidth        GROUP_EqualWidth, TRUE
  113. #define EqualHeight        GROUP_EqualHeight, TRUE
  114.  
  115. /*****************************************************************************
  116.  *
  117.  *    Layout macros.
  118.  */
  119. #define FixMinWidth        LGO_FixMinWidth, TRUE
  120. #define FixMinHeight        LGO_FixMinHeight, TRUE
  121. #define Weight(w)        LGO_Weight, w
  122. #define FixWidth(w)        LGO_FixWidth, w
  123. #define FixHeight(h)        LGO_FixHeight, h
  124. #define Align            LGO_Align, TRUE
  125. #define FixMinSize        FixMinWidth, FixMinHeight
  126. #define FixSize(w,h)        FixWidth(w), FixHeight(h)
  127. #define NoAlign                 LGO_NoAlign, TRUE
  128.  
  129. /*****************************************************************************
  130.  *
  131.  *    Page class macros.
  132.  */
  133. #define PageMember        PAGE_Member
  134.  
  135. /*****************************************************************************
  136.  *
  137.  *    "Quick" button creation macros.
  138.  */
  139. #define Button(label,id)\
  140.     ButtonObject,\
  141.         LAB_Label,        label,\
  142.         GA_ID,            id,\
  143.         ButtonFrame,\
  144.     EndObject
  145.  
  146. #define KeyButton(label,id)\
  147.     ButtonObject,\
  148.         LAB_Label,        label,\
  149.         LAB_Underscore,         '_',\
  150.         GA_ID,            id,\
  151.         ButtonFrame,\
  152.     EndObject
  153.  
  154. #define Toggle(label,state,id)\
  155.     ToggleObject,\
  156.         LAB_Label,        label,\
  157.         GA_ID,            id,\
  158.         GA_Selected,        state,\
  159.         ButtonFrame,\
  160.     EndObject
  161.  
  162. #define KeyToggle(label,state,id)\
  163.     ToggleObject,\
  164.         LAB_Label,        label,\
  165.         LAB_Underscore,         '_',\
  166.         GA_ID,            id,\
  167.         GA_Selected,        state,\
  168.         ButtonFrame,\
  169.     EndObject
  170.  
  171. #define XenButton(label,id)\
  172.     ButtonObject,\
  173.         LAB_Label,        label,\
  174.         GA_ID,            id,\
  175.         XenFrame,\
  176.     EndObject
  177.  
  178. #define XenKeyButton(label,id)\
  179.     ButtonObject,\
  180.         LAB_Label,        label,\
  181.         LAB_Underscore,         '_',\
  182.         GA_ID,            id,\
  183.         XenFrame,\
  184.     EndObject
  185.  
  186. #define XenToggle(label,state,id)\
  187.     ToggleObject,\
  188.         LAB_Label,        label,\
  189.         GA_ID,            id,\
  190.         GA_Selected,        state,\
  191.         XenFrame,\
  192.     EndObject
  193.  
  194. #define XenKeyToggle(label,state,id)\
  195.     ToggleObject,\
  196.         LAB_Label,        label,\
  197.         LAB_Underscore,         '_',\
  198.         GA_ID,            id,\
  199.         GA_Selected,        state,\
  200.         XenFrame,\
  201.     EndObject
  202.  
  203. /*****************************************************************************
  204.  *
  205.  *    "Quick" cycle creation macros.
  206.  */
  207. #define Cycle(label,labels,active,id)\
  208.     CycleObject,\
  209.         LAB_Label,        label,\
  210.         GA_ID,            id,\
  211.         ButtonFrame,\
  212.         CYC_Labels,        labels,\
  213.         CYC_Active,        active,\
  214.     EndObject
  215.  
  216. #define KeyCycle(label,labels,active,id)\
  217.     CycleObject,\
  218.         LAB_Label,        label,\
  219.         LAB_Underscore,         '_',\
  220.         GA_ID,            id,\
  221.         ButtonFrame,\
  222.         CYC_Labels,        labels,\
  223.         CYC_Active,        active,\
  224.     EndObject
  225.  
  226. #define XenCycle(label,labels,active,id)\
  227.     CycleObject,\
  228.         LAB_Label,        label,\
  229.         GA_ID,            id,\
  230.         XenFrame,\
  231.         CYC_Labels,        labels,\
  232.         CYC_Active,        active,\
  233.     EndObject
  234.  
  235. #define XenKeyCycle(label,labels,active,id)\
  236.     CycleObject,\
  237.         LAB_Label,        label,\
  238.         LAB_Underscore,         '_',\
  239.         GA_ID,            id,\
  240.         XenFrame,\
  241.         CYC_Labels,        labels,\
  242.         CYC_Active,        active,\
  243.     EndObject
  244.  
  245. #define PopCycle(label,labels,active,id)\
  246.     CycleObject,\
  247.         LAB_Label,        label,\
  248.         GA_ID,            id,\
  249.         ButtonFrame,\
  250.         CYC_Labels,        labels,\
  251.         CYC_Active,        active,\
  252.         CYC_Popup,        TRUE,\
  253.     EndObject
  254.  
  255. #define KeyPopCycle(label,labels,active,id)\
  256.     CycleObject,\
  257.         LAB_Label,        label,\
  258.         LAB_Underscore,         '_',\
  259.         GA_ID,            id,\
  260.         ButtonFrame,\
  261.         CYC_Labels,        labels,\
  262.         CYC_Active,        active,\
  263.         CYC_Popup,        TRUE,\
  264.     EndObject
  265.  
  266. #define XenPopCycle(label,labels,active,id)\
  267.     CycleObject,\
  268.         LAB_Label,        label,\
  269.         GA_ID,            id,\
  270.         XenFrame,\
  271.         CYC_Labels,        labels,\
  272.         CYC_Active,        active,\
  273.         CYC_Popup,        TRUE,\
  274.     EndObject
  275.  
  276. #define XenKeyPopCycle(label,labels,active,id)\
  277.     CycleObject,\
  278.         LAB_Label,        label,\
  279.         LAB_Underscore,         '_',\
  280.         GA_ID,            id,\
  281.         XenFrame,\
  282.         CYC_Labels,        labels,\
  283.         CYC_Active,        active,\
  284.         CYC_Popup,        TRUE,\
  285.     EndObject
  286.  
  287. /*****************************************************************************
  288.  *
  289.  *    "Quick" checkbox creation macros.
  290.  */
  291. #define CheckBox(label,state,id)\
  292.     CheckBoxObject,\
  293.         LAB_Label,        label,\
  294.         GA_ID,            id,\
  295.         ButtonFrame,\
  296.         FRM_Flags,        FRF_EDGES_ONLY,\
  297.         GA_Selected,        state,\
  298.     EndObject, FixMinSize
  299.  
  300. #define KeyCheckBox(label,state,id)\
  301.     CheckBoxObject,\
  302.         LAB_Label,        label,\
  303.         LAB_Underscore,         '_',\
  304.         GA_ID,            id,\
  305.         ButtonFrame,\
  306.         FRM_Flags,        FRF_EDGES_ONLY,\
  307.         GA_Selected,        state,\
  308.     EndObject, FixMinSize
  309.  
  310. #define XenCheckBox(label,state,id)\
  311.     CheckBoxObject,\
  312.         LAB_Label,        label,\
  313.         GA_ID,            id,\
  314.         XenFrame,\
  315.         FRM_Flags,        FRF_EDGES_ONLY,\
  316.         GA_Selected,        state,\
  317.     EndObject, FixMinSize
  318.  
  319. #define XenKeyCheckBox(label,state,id)\
  320.     CheckBoxObject,\
  321.         LAB_Label,        label,\
  322.         LAB_Underscore,         '_',\
  323.         GA_ID,            id,\
  324.         XenFrame,\
  325.         FRM_Flags,        FRF_EDGES_ONLY,\
  326.         GA_Selected,        state,\
  327.     EndObject, FixMinSize
  328.  
  329. #define CheckBoxNF(label,state,id)\
  330.     CheckBoxObject,\
  331.         LAB_Label,        label,\
  332.         GA_ID,            id,\
  333.         ButtonFrame,\
  334.         FRM_Flags,        FRF_EDGES_ONLY,\
  335.         GA_Selected,        state,\
  336.     EndObject,
  337.  
  338. #define KeyCheckBoxNF(label,state,id)\
  339.     CheckBoxObject,\
  340.         LAB_Label,        label,\
  341.         LAB_Underscore,         '_',\
  342.         GA_ID,            id,\
  343.         ButtonFrame,\
  344.         FRM_Flags,        FRF_EDGES_ONLY,\
  345.         GA_Selected,        state,\
  346.     EndObject,
  347.  
  348. #define XenCheckBoxNF(label,state,id)\
  349.     CheckBoxObject,\
  350.         LAB_Label,        label,\
  351.         GA_ID,            id,\
  352.         XenFrame,\
  353.         FRM_Flags,        FRF_EDGES_ONLY,\
  354.         GA_Selected,        state,\
  355.     EndObject,
  356.  
  357. #define XenKeyCheckBoxNF(label,state,id)\
  358.     CheckBoxObject,\
  359.         LAB_Label,        label,\
  360.         LAB_Underscore,         '_',\
  361.         GA_ID,            id,\
  362.         XenFrame,\
  363.         FRM_Flags,        FRF_EDGES_ONLY,\
  364.         GA_Selected,        state,\
  365.     EndObject,
  366.  
  367. /*****************************************************************************
  368.  *
  369.  *    "Quick" info object creation macros.
  370.  */
  371. #define InfoFixed(label,text,args,numlines)\
  372.     InfoObject,\
  373.         LAB_Label,        label,\
  374.         ButtonFrame,\
  375.         FRM_Flags,        FRF_RECESSED,\
  376.         INFO_TextFormat,    text,\
  377.         INFO_Args,        args,\
  378.         INFO_MinLines,        numlines,\
  379.         INFO_FixTextWidth,    TRUE,\
  380.     EndObject
  381.  
  382. #define InfoObj(label,text,args,numlines)\
  383.     InfoObject,\
  384.         LAB_Label,        label,\
  385.         ButtonFrame,\
  386.         FRM_Flags,        FRF_RECESSED,\
  387.         INFO_TextFormat,    text,\
  388.         INFO_Args,        args,\
  389.         INFO_MinLines,        numlines,\
  390.     EndObject
  391.  
  392. /*****************************************************************************
  393.  *
  394.  *    "Quick" string/integer creation macros.
  395.  */
  396. #define String(label,contents,maxchars,id)\
  397.     StringObject,\
  398.         LAB_Label,        label,\
  399.         RidgeFrame,\
  400.         STRINGA_TextVal,    contents,\
  401.         STRINGA_MaxChars,    maxchars,\
  402.         GA_ID,            id,\
  403.     EndObject
  404.  
  405. #define KeyString(label,contents,maxchars,id)\
  406.     StringObject,\
  407.         LAB_Label,        label,\
  408.         LAB_Underscore,         '_',\
  409.         RidgeFrame,\
  410.         STRINGA_TextVal,    contents,\
  411.         STRINGA_MaxChars,    maxchars,\
  412.         GA_ID,            id,\
  413.     EndObject
  414.  
  415. #define TabString(label,contents,maxchars,id)\
  416.     StringObject,\
  417.         LAB_Label,        label,\
  418.         RidgeFrame,\
  419.         STRINGA_TextVal,    contents,\
  420.         STRINGA_MaxChars,    maxchars,\
  421.         GA_ID,            id,\
  422.         GA_TabCycle,        TRUE,\
  423.     EndObject
  424.  
  425. #define TabKeyString(label,contents,maxchars,id)\
  426.     StringObject,\
  427.         LAB_Label,        label,\
  428.         LAB_Underscore,         '_',\
  429.         RidgeFrame,\
  430.         STRINGA_TextVal,    contents,\
  431.         STRINGA_MaxChars,    maxchars,\
  432.         GA_ID,            id,\
  433.         GA_TabCycle,        TRUE,\
  434.     EndObject
  435.  
  436. #define Integer(label,contents,maxchars,id)\
  437.     StringObject,\
  438.         LAB_Label,        label,\
  439.         RidgeFrame,\
  440.         STRINGA_LongVal,    contents,\
  441.         STRINGA_MaxChars,    maxchars,\
  442.         GA_ID,            id,\
  443.     EndObject
  444.  
  445. #define KeyInteger(label,contents,maxchars,id)\
  446.     StringObject,\
  447.         LAB_Label,        label,\
  448.         LAB_Underscore,         '_',\
  449.         RidgeFrame,\
  450.         STRINGA_LongVal,    contents,\
  451.         STRINGA_MaxChars,    maxchars,\
  452.         GA_ID,            id,\
  453.     EndObject
  454.  
  455. #define TabInteger(label,contents,maxchars,id)\
  456.     StringObject,\
  457.         LAB_Label,        label,\
  458.         RidgeFrame,\
  459.         STRINGA_LongVal,    contents,\
  460.         STRINGA_MaxChars,    maxchars,\
  461.         GA_ID,            id,\
  462.         GA_TabCycle,        TRUE,\
  463.     EndObject
  464.  
  465. #define TabKeyInteger(label,contents,maxchars,id)\
  466.     StringObject,\
  467.         LAB_Label,        label,\
  468.         LAB_Underscore,         '_',\
  469.         RidgeFrame,\
  470.         STRINGA_LongVal,    contents,\
  471.         STRINGA_MaxChars,    maxchars,\
  472.         GA_ID,            id,\
  473.         GA_TabCycle,        TRUE,\
  474.     EndObject
  475.  
  476. /*
  477.  *    STRINGA_Pens & STRINGA_ActivePens pen-pack macro.
  478.  */
  479. #define PACKPENS(a,b) (((b<<8)&0xFF00)|((a)&0x00FF))
  480.  
  481. /*****************************************************************************
  482.  *
  483.  *    "Quick" scroller creation macros.
  484.  */
  485. #define HorizScroller(label,top,total,visible,id)\
  486.     PropObject,\
  487.         LAB_Label,        label,\
  488.         PGA_Top,        top,\
  489.         PGA_Total,        total,\
  490.         PGA_Visible,        visible,\
  491.         PGA_Freedom,        FREEHORIZ,\
  492.         GA_ID,            id,\
  493.         PGA_Arrows,        TRUE,\
  494.     EndObject
  495.  
  496. #define VertScroller(label,top,total,visible,id)\
  497.     PropObject,\
  498.         LAB_Label,        label,\
  499.         PGA_Top,        top,\
  500.         PGA_Total,        total,\
  501.         PGA_Visible,        visible,\
  502.         GA_ID,            id,\
  503.         PGA_Arrows,        TRUE,\
  504.     EndObject
  505.  
  506. #define KeyHorizScroller(label,top,total,visible,id)\
  507.     PropObject,\
  508.         LAB_Label,        label,\
  509.         LAB_Underscore,         '_',\
  510.         PGA_Top,        top,\
  511.         PGA_Total,        total,\
  512.         PGA_Visible,        visible,\
  513.         PGA_Freedom,        FREEHORIZ,\
  514.         GA_ID,            id,\
  515.         PGA_Arrows,        TRUE,\
  516.     EndObject
  517.  
  518. #define KeyVertScroller(label,top,total,visible,id)\
  519.     PropObject,\
  520.         LAB_Label,        label,\
  521.         LAB_Underscore,         '_',\
  522.         PGA_Top,        top,\
  523.         PGA_Total,        total,\
  524.         PGA_Visible,        visible,\
  525.         GA_ID,            id,\
  526.         PGA_Arrows,        TRUE,\
  527.     EndObject
  528.  
  529. /*****************************************************************************
  530.  *
  531.  *    "Quick" indicator creation macros.
  532.  */
  533. #define Indicator(min,max,level,just)\
  534.     IndicatorObject,\
  535.         INDIC_Min,        min,\
  536.         INDIC_Max,        max,\
  537.         INDIC_Level,        level,\
  538.         INDIC_Justification,    just,\
  539.     EndObject
  540.  
  541. #define IndicatorFormat(min,max,level,just,format)\
  542.     IndicatorObject,\
  543.         INDIC_Min,        min,\
  544.         INDIC_Max,        max,\
  545.         INDIC_Level,        level,\
  546.         INDIC_Justification,    just,\
  547.         INDIC_FormatString,    format,\
  548.     EndObject
  549.  
  550. /*****************************************************************************
  551.  *
  552.  *    "Quick" progress creation macros.
  553.  */
  554. #define HorizProgress(label,min,max,done)\
  555.     ProgressObject,\
  556.         LAB_Label,        label,\
  557.         ButtonFrame,\
  558.         FRM_Flags,        FRF_RECESSED,\
  559.         PROGRESS_Min,        min,\
  560.         PROGRESS_Max,        max,\
  561.         PROGRESS_Done,        done,\
  562.     EndObject
  563.  
  564. #define VertProgress(label,min,max,done)\
  565.     ProgressObject,\
  566.         LAB_Label,        label,\
  567.         ButtonFrame,\
  568.         FRM_Flags,        FRF_RECESSED,\
  569.         PROGRESS_Min,        min,\
  570.         PROGRESS_Max,        max,\
  571.         PROGRESS_Done,        done,\
  572.         PROGRESS_Vertical,    TRUE,\
  573.     EndObject
  574.  
  575. /*****************************************************************************
  576.  *
  577.  *    "Quick" slider creation macros.
  578.  */
  579. #define HorizSlider(label,min,max,level,id)\
  580.     SliderObject,\
  581.         LAB_Label,        label,\
  582.         SLIDER_Min,        min,\
  583.         SLIDER_Max,        max,\
  584.         SLIDER_Level,        level,\
  585.         GA_ID,            id,\
  586.     EndObject
  587.  
  588. #define VertSlider(label,min,max,level,id)\
  589.     SliderObject,\
  590.         LAB_Label,        label,\
  591.         SLIDER_Min,        min,\
  592.         SLIDER_Max,        max,\
  593.         SLIDER_Level,        level,\
  594.         PGA_Freedom,        FREEVERT,\
  595.         GA_ID,            id,\
  596.     EndObject
  597.  
  598. #define KeyHorizSlider(label,min,max,level,id)\
  599.     SliderObject,\
  600.         LAB_Label,        label,\
  601.         LAB_Underscore,         '_',\
  602.         SLIDER_Min,        min,\
  603.         SLIDER_Max,        max,\
  604.         SLIDER_Level,        level,\
  605.         GA_ID,            id,\
  606.     EndObject
  607.  
  608. #define KeyVertSlider(label,min,max,level,id)\
  609.     SliderObject,\
  610.         LAB_Label,        label,\
  611.         LAB_Underscore,         '_',\
  612.         SLIDER_Min,        min,\
  613.         SLIDER_Max,        max,\
  614.         SLIDER_Level,        level,\
  615.         PGA_Freedom,        FREEVERT,\
  616.         GA_ID,            id,\
  617.     EndObject
  618.  
  619. /*****************************************************************************
  620.  *
  621.  *    "Quick" mx creation macros.
  622.  */
  623. #define RightMx(label,labels,active,id)\
  624.     MxObject,\
  625.         GROUP_Style,        GRSTYLE_VERTICAL,\
  626.         LAB_Label,        label,\
  627.         MX_Labels,        labels,\
  628.         MX_Active,        active,\
  629.         GA_ID,            id,\
  630.     EndObject, FixMinSize
  631.  
  632. #define LeftMx(label,labels,active,id)\
  633.     MxObject,\
  634.         GROUP_Style,        GRSTYLE_VERTICAL,\
  635.         LAB_Label,        label,\
  636.         MX_Labels,        labels,\
  637.         MX_Active,        active,\
  638.         MX_LabelPlace,        PLACE_LEFT,\
  639.         GA_ID,            id,\
  640.     EndObject, FixMinSize
  641.  
  642. #define RightMxKey(label,labels,active,id)\
  643.     MxObject,\
  644.         GROUP_Style,        GRSTYLE_VERTICAL,\
  645.         LAB_Label,        label,\
  646.         LAB_Underscore,         '_',\
  647.         MX_Labels,        labels,\
  648.         MX_Active,        active,\
  649.         GA_ID,            id,\
  650.     EndObject, FixMinSize
  651.  
  652. #define LeftMxKey(label,labels,active,id)\
  653.     MxObject,\
  654.         GROUP_Style,        GRSTYLE_VERTICAL,\
  655.         LAB_Label,        label,\
  656.         LAB_Underscore,         '_',\
  657.         MX_Labels,        labels,\
  658.         MX_Active,        active,\
  659.         MX_LabelPlace,        PLACE_LEFT,\
  660.         GA_ID,            id,\
  661.     EndObject, FixMinSize
  662.  
  663. #define Tabs(label,labels,active,id)\
  664.     MxObject,\
  665.         MX_TabsObject,        TRUE,\
  666.         LAB_Label,        label,\
  667.         MX_Labels,        labels,\
  668.         MX_Active,        active,\
  669.         GA_ID,            id,\
  670.     EndObject, FixMinHeight
  671.  
  672. #define TabsKey(label,labels,active,id)\
  673.     MxObject,\
  674.         MX_TabsObject,        TRUE,\
  675.         LAB_Label,        label,\
  676.         LAB_Underscore,         '_',\
  677.         MX_Labels,        labels,\
  678.         MX_Active,        active,\
  679.         GA_ID,            id,\
  680.     EndObject, FixMinHeight
  681.  
  682. #define TabsEqual(label,labels,active,id)\
  683.     MxObject,\
  684.         GROUP_EqualWidth,    TRUE,\
  685.         MX_TabsObject,        TRUE,\
  686.         LAB_Label,        label,\
  687.         MX_Labels,        labels,\
  688.         MX_Active,        active,\
  689.         GA_ID,            id,\
  690.     EndObject, FixMinHeight
  691.  
  692. #define TabsEqualKey(label,labels,active,id)\
  693.     MxObject,\
  694.         GROUP_EqualWidth,    TRUE,\
  695.         MX_TabsObject,        TRUE,\
  696.         LAB_Label,        label,\
  697.         LAB_Underscore,         '_',\
  698.         MX_Labels,        labels,\
  699.         MX_Active,        active,\
  700.         GA_ID,            id,\
  701.     EndObject, FixMinHeight
  702.  
  703. /*****************************************************************************
  704.  *
  705.  *    "Quick" listview creation macros.
  706.  */
  707. #define StrListview(label,strings,id)\
  708.     ListviewObject,\
  709.         LAB_Label,        label,\
  710.         GA_ID,            id,\
  711.         LISTV_EntryArray,    strings,\
  712.     EndObject
  713.  
  714. #define StrListviewSorted(label,strings,id)\
  715.     ListviewObject,\
  716.         LAB_Label,        label,\
  717.         GA_ID,            id,\
  718.         LISTV_EntryArray,    strings,\
  719.         LISTV_SortEntryArray,    TRUE,\
  720.     EndObject
  721.  
  722. #define ReadStrListview(label,strings)\
  723.     ListviewObject,\
  724.         LAB_Label,        label,\
  725.         LISTV_EntryArray,    strings,\
  726.         LISTV_ReadOnly,         TRUE,\
  727.     EndObject
  728.  
  729. #define ReadStrListviewSorted(label,strings)\
  730.     ListviewObject,\
  731.         LAB_Label,        label,\
  732.         LISTV_EntryArray,    strings,\
  733.         LISTV_SortEntryArray,    TRUE,\
  734.         LISTV_ReadOnly,         TRUE,\
  735.     EndObject
  736.  
  737. #define MultiStrListview(label,strings,id)\
  738.     ListviewObject,\
  739.         LAB_Label,        label,\
  740.         GA_ID,            id,\
  741.         LISTV_EntryArray,    strings,\
  742.         LISTV_MultiSelect,    TRUE,\
  743.     EndObject
  744.  
  745. #define MultiStrListviewSorted(label,strings,id)\
  746.     ListviewObject,\
  747.         LAB_Label,        label,\
  748.         GA_ID,            id,\
  749.         LISTV_EntryArray,    strings,\
  750.         LISTV_SortEntryArray,    TRUE,\
  751.         LISTV_MultiSelect,    TRUE,\
  752.     EndObject
  753.  
  754. /*****************************************************************************
  755.  *
  756.  *    "Quick" separator bar creation macros.
  757.  */
  758. #define VertSeparator\
  759.     SeperatorObject,\
  760.     EndObject, FixMinWidth
  761.  
  762. #define VertThinSeparator\
  763.     SeperatorObject,\
  764.         SEP_Thin,        TRUE,\
  765.     EndObject, FixMinWidth
  766.  
  767. #define HorizSeparator\
  768.     SeperatorObject,\
  769.         SEP_Horiz,        TRUE,\
  770.     EndObject, FixMinHeight
  771.  
  772. #define TitleSeparator(t)\
  773.     SeperatorObject,\
  774.         SEP_Horiz,        TRUE,\
  775.         SEP_Title,        t,\
  776.     EndObject, FixMinHeight
  777.  
  778. #define HTitleSeparator(t)\
  779.     SeperatorObject,\
  780.         SEP_Horiz,        TRUE,\
  781.         SEP_Title,        t,\
  782.         SEP_Highlight,        TRUE,\
  783.     EndObject, FixMinHeight
  784.  
  785. #define CTitleSeparator(t)\
  786.     SeperatorObject,\
  787.         SEP_Horiz,        TRUE,\
  788.         SEP_Title,        t,\
  789.         SEP_CenterTitle,    TRUE,\
  790.     EndObject, FixMinHeight
  791.  
  792. #define CHTitleSeparator(t)\
  793.     SeperatorObject,\
  794.         SEP_Horiz,        TRUE,\
  795.         SEP_Title,        t,\
  796.         SEP_Highlight,        TRUE,\
  797.         SEP_CenterTitle,    TRUE,\
  798.     EndObject, FixMinHeight
  799.  
  800. /* Typos */
  801. #define VertSeperator        VertSeparator
  802. #define VertThinSeperator    VertThinSeparator
  803. #define HorizSeperator        HorizSeparator
  804. #define TitleSeperator        TitleSeparator
  805. #define HTitleSeperator         HTitleSeparator
  806. #define CTitleSeperator         CTitleSeparator
  807. #define CHTitleSeperator    CHTitleSeparator
  808.  
  809. /*****************************************************************************
  810.  *
  811.  *    Some simple menu macros.
  812.  */
  813. #define Title(t)\
  814.     { NM_TITLE, t, NULL, 0, 0, NULL }
  815. #define Item(t,s,i)\
  816.     { NM_ITEM, t, s, 0, 0, (APTR)i }
  817. #define ItemBar\
  818.     { NM_ITEM, NM_BARLABEL, NULL, 0, 0, NULL }
  819. #define SubItem(t,s,i)\
  820.     { NM_SUB, t, s, 0, 0, (APTR)i }
  821. #define SubBar\
  822.     { NM_SUB, NM_BARLABEL, NULL, 0, 0, NULL }
  823. #define End\
  824.     { NM_END, NULL, NULL, 0, 0, NULL }
  825.  
  826. /*****************************************************************************
  827.  *
  828.  *    Base class method macros.
  829.  */
  830. #define AddMap(object,target,map)\
  831.     DoMethod( object, BASE_ADDMAP, target, map )
  832.  
  833. #define AddCondit(object,target,ttag,tdat,ftag,fdat,stag,sdat)\
  834.     DoMethod( object, BASE_ADDCONDITIONAL, target,\
  835.           ttag, tdat,\
  836.           ftag, fdat,\
  837.           stag, sdat )
  838.  
  839. #define AddHook(object,hook)\
  840.     DoMethod( object, BASE_ADDHOOK, hook )
  841.  
  842. #define RemMap(object,target)\
  843.     DoMethod( object, BASE_REMMAP, target )
  844.  
  845. #define RemCondit(object,target)\
  846.     DoMethod( object, BASE_REMCONDITIONAL, target )
  847.  
  848. #define RemHook( object,hook)\
  849.     DoMethod( object, BASE_REMHOOK, hook )
  850.  
  851. /*****************************************************************************
  852.  *
  853.  *    Listview class method macros.
  854.  */
  855. #define AddEntry(window,object,entry,how)\
  856.     BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  857.                  NULL, entry, how, 0L )
  858.  
  859. #define AddEntryVisible(window,object,entry,how)\
  860.     BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  861.                  NULL, entry, how, LVASF_MAKEVISIBLE )
  862.  
  863. #define AddEntrySelect(window,object,entry,how)\
  864.     BGUI_DoGadgetMethod( object, window, NULL, LVM_ADDSINGLE,\
  865.                  NULL, entry, how, LVASF_SELECT )
  866.  
  867. #define ClearList(window,object)\
  868.     BGUI_DoGadgetMethod( object, window, NULL, LVM_CLEAR, NULL )
  869.  
  870. #define FirstEntry(object)\
  871.     DoMethod( object, LVM_FIRSTENTRY, NULL, 0L )
  872.  
  873. #define FirstSelected(object)\
  874.     DoMethod( object, LVM_FIRSTENTRY, NULL, LVGEF_SELECTED )
  875.  
  876. #define LastEntry(object)\
  877.     DoMethod( object, LVM_LASTENTRY, NULL, 0L )
  878.  
  879. #define LastSelected(object)\
  880.     DoMethod( object, LVM_LASTENTRY, NULL, LVGEF_SELECTED )
  881.  
  882. #define NextEntry(object,last)\
  883.     DoMethod( object, LVM_NEXTENTRY, last, 0L )
  884.  
  885. #define NextSelected(object,last)\
  886.     DoMethod( object, LVM_NEXTENTRY, last, LVGEF_SELECTED )
  887.  
  888. #define PrevEntry(object,last)\
  889.     DoMethod( object, LVM_PREVENTRY, last, 0L )
  890.  
  891. #define PrevSelected(object,last)\
  892.     DoMethod( object, LVM_PREVENTRY, last, LVGEF_SELECTED )
  893.  
  894. #define RemoveEntry(object,entry)\
  895.     DoMethod( object, LVM_REMENTRY, NULL, entry )
  896.  
  897. #define RemoveEntryVisible(window,object,entry)\
  898.     BGUI_DoGadgetMethod( object, window, NULL, LVM_REMENTRY, NULL, entry )
  899.  
  900. #define RefreshList(window,object)\
  901.     BGUI_DoGadgetMethod( object, window, NULL, LVM_REFRESH, NULL )
  902.  
  903. #define SortList(window,object)\
  904.     BGUI_DoGadgetMethod( object, window, NULL, LVM_SORT, NULL )
  905.  
  906. #define LockList(object)\
  907.     DoMethod( object, LVM_LOCKLIST, NULL )
  908.  
  909. #define UnlockList(window,object)\
  910.     BGUI_DoGadgetMethod( object, window, NULL, LVM_UNLOCKLIST, NULL )
  911.  
  912. #define MoveEntry(window,object,entry,dir)\
  913.     BGUI_DoGadgetMethod( object, window, NULL, LVM_MOVE, NULL,\
  914.                  entry, dir )
  915.  
  916. #define MoveSelectedEntry(window,object,dir)\
  917.     BGUI_DoGadgetMethod( object, window, NULL, LVM_MOVE, NULL,\
  918.                  NULL, dir )
  919.  
  920. #define ReplaceEntry(window,object,old,new)\
  921.     BGUI_DoGadgetMethod( object, window, NULL, LVM_REPLACE, NULL,\
  922.                  old, new )
  923.  
  924. /*****************************************************************************
  925.  *
  926.  *    Window class method macros.
  927.  */
  928. #define GadgetKey(wobj,gobj,key)\
  929.     DoMethod( wobj, WM_GADGETKEY, NULL, gobj, key )
  930.  
  931. #define WindowOpen(wobj)\
  932.     ( struct Window * )DoMethod( wobj, WM_OPEN )
  933.  
  934. #define WindowClose(wobj)\
  935.     DoMethod( wobj, WM_CLOSE )
  936.  
  937. #define WindowBusy(wobj)\
  938.     DoMethod( wobj, WM_SLEEP )
  939.  
  940. #define WindowReady(wobj)\
  941.     DoMethod( wobj, WM_WAKEUP )
  942.  
  943. #define HandleEvent(wobj)\
  944.     DoMethod( wobj, WM_HANDLEIDCMP )
  945.  
  946. #define DisableMenu(wobj,id,set)\
  947.     DoMethod( wobj, WM_DISABLEMENU, id, set )
  948.  
  949. #define CheckItem(wobj,id,set)\
  950.     DoMethod( wobj, WM_CHECKITEM, id, set )
  951.  
  952. #define MenuDisabled(wobj,id)\
  953.     DoMethod( wobj, WM_MENUDISABLED, id )
  954.  
  955. #define ItemChecked(wobj,id)\
  956.     DoMethod( wobj, WM_ITEMCHECKED, id )
  957.  
  958. #define GetAppMsg(wobj)\
  959.     ( struct AppMessage * )DoMethod( wobj, WM_GETAPPMSG )
  960.  
  961. #define AddUpdate(wobj,id,target,map)\
  962.     DoMethod( wobj, WM_ADDUPDATE, id, target, map )
  963.  
  964. #define GetSignalWindow(wobj)\
  965.     ( struct Window * )DoMethod( wobj, WM_GET_SIGNAL_WINDOW )
  966.  
  967. /*****************************************************************************
  968.  *
  969.  *    Commodity class method macros.
  970.  */
  971. #define AddHotkey(broker,desc,id,flags)\
  972.     DoMethod( broker, CM_ADDHOTKEY, desc, id, flags )
  973.  
  974. #define RemHotkey(broker,id)\
  975.     DoMethod( broker, CM_REMHOTKEY, id )
  976.  
  977. #define DisableHotkey(broker,id)\
  978.     DoMethod( broker, CM_DISABLEHOTKEY, id )
  979.  
  980. #define EnableHotKey(broker,id)\
  981.     DoMethod( broker, CM_ENABLEHOTKEY, id )
  982.  
  983. #define EnableBroker(broker)\
  984.     DoMethod( broker, CM_ENABLEBROKER )
  985.  
  986. #define DisableBroker(broker)\
  987.     DoMethod( broker, CM_DISABLEBROKER )
  988.  
  989. #define MsgInfo(broker,type,id,data)\
  990.     DoMethod( broker, CM_MSGINFO,\
  991.           ( ULONG * )type,\
  992.           ( ULONG * )id,\
  993.           ( ULONG * )data )
  994.  
  995. /*****************************************************************************
  996.  *
  997.  *    FileReq class method macros.
  998.  */
  999. #define DoRequest(object)\
  1000.     DoMethod( object, FRM_DOREQUEST )
  1001.  
  1002. #endif /* LIBRARIES_BGUI_MACROS_H */
  1003.